package com.lagou.client.util;

import org.I0Itec.zkclient.ZkClient;

/**
 * @author Kirito
 * @description:
 * @date 2020/06/04
 */
public class ZkClientUtil {

    private static ZkClient zkClient;

    static {
        zkClient = new ZkClient("192.168.73.128:2181");
    }

    private ZkClientUtil() {
    }


    public static ZkClient getZkClient() {
        return zkClient;
    }

    public static void setResponse(String path, Object data) {
        zkClient.writeData("/servers/" + path, data);
    }

    public static Object getResponse(String path) {
        return zkClient.readData("/servers/" + path);
    }

}
